//百度搜索提示
function get(data) {
    //console.log(data.g);
    let response = data.g;
    if (!response) {
        oUL.innerHTML = "";
        return;
    }
    let lihtml = "";
    for (let i = 0; i < response.length; i++) {
        lihtml += "<li>" + response[i].q + "</li>";
    }
    oUL.innerHTML = lihtml;
}
let oUL = document.getElementById("search_list");
let input = document.getElementById("search_tip");
input.oninput = function () {
    let script = document.createElement("script");
    let url = "https://www.baidu.com/sugrec?prod=pc";
    url += "&wd=" + input.value;
    url += "&cb=get";
    script.src = url;
    document.body.appendChild(script);
    script.onload = function(){
        script.parentNode.removeChild(script);
    }
}